﻿


class GameOfLife implements IGenerateContent{
    private drawGrid: IDrawGrid;
    private grid: IGrid;

    //static RunTests() {

    //    AllTests.Run();
    //    return false;
    //}

    constructor() {
        var createGrid = new DefaultCreateGrid(50, 50);
        //var createGrid = new Modulo2CreateGrid(200, 100);

        var initGrid = new DefaultInitGrid();
        //var initGrid = new TextInitGrid();

       // this.drawGrid = new HistoryDrawGrid();
        this.drawGrid = new DefaultDrawGrid();

        //var getCells = new DefaultGetCell();
        var getCells = new TorusGetCell();

        this.grid = new DefaultGrid(createGrid, initGrid, this.drawGrid, getCells);


    }

    GenerateContent(drawArea:IDrawArea) {
        this.grid.GenerateContent(drawArea);
    }
      
    //    }
    //    else {
    //        if (this.loaded == true) {
    //            var element = document.getElementById('canvas');
    //            var canvas: HTMLCanvasElement = <HTMLCanvasElement>element;
    //            canvas.width = 0;
    //            canvas.height = 0;
    //            this.drawGrid.Init(this.grid);
    //        }
    //    }
    //}
}

